// 数据回显Mock
Mock.mock("/js/showteaPage", "post", function () {
    let teaarr = localStorage.Tea;
    let teashowdiv = document.querySelector(".teashowpage");
    let showPage = "";
    if (teaarr == "" || teaarr == null || teaarr == undefined || teaarr == []) {
        teashowdiv.innerHTML =
            `<div>
                <a href=""><img src="../imgs/" alt=""></a>
                <div class="teaname">暂无数据</div>
                <p>暂无数据</p>
                <button>→</button>    
            </div>`;
    } else {
        let tea = JSON.parse(teaarr);
        for (let i = 0; i < tea.length; i++) {
            showPage += `<div onclick="showTeaPage(${tea[i].teaid})">
                <a href="" ><img src="../imgs/${tea[i].teaimg}" alt="" ></a>
                <div class="teaname" onclick="showTeaPage(${tea[i].teaid})">${tea[i].teaname}</div>
                <p>￥${tea[i].teaprice}</p>
                <button onclick="showTeaPage(${tea[i].teaid})">→</button>
                </div>`
        }
    }

    return showPage;
})
// 选择茶叶类型返回数据
Mock.mock("/js/selectTeaShowPage", "post", function () {
    let teaarr = localStorage.Tea;
    return teaarr;
})
// 将本地存储返回给/js/showTeaPageGetLocal
Mock.mock("/js/showTeaPageGetLocal", "post", function () {
    let local = localStorage.Tea;
    return local;
})